package com.demo.livemanagement.livedelayqueue;

import java.util.Date;

import org.apache.log4j.Logger;

public class DelayQueueMaxSizeTest {

	private static final Logger LOGGER = Logger.getLogger(TestQueue.class);
	public static void main(String[] args) {
		@SuppressWarnings("unchecked")
		LiveDelayQueue<LiveDelayInfo> qu = LiveDelayQueue.getInstance();
		long count = 0;
		while (true) {
			try {
				Thread.sleep(30000);
			} catch (InterruptedException e) {
				e.printStackTrace();
			}
			count++;
			LiveDelayInfo element = new LiveDelayInfo(new Date(), "test" + count);
			qu.offer(element);
			LOGGER.info("LiveDelayQueue size: " + qu.size());
		}
	}
}
